package club.mzywucai.blog.air_portal.service.impl;

import club.mzywucai.blog.air_portal.mapper.FileInfoMapper;
import club.mzywucai.blog.air_portal.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mzywucai
 * @Description 定时调度任务需要做的。
 * @date 2019/6/3
 */
@Service
public class ScheduleServiceImpl implements ScheduleService {

    @Autowired
    FileInfoMapper fileInforMapper;

    @Override
    public void delFiles() {
        // 删除过期文件
        fileInforMapper.delFiles();
    }

    @Override
    public List<String> getFileCodeList() {
        // 这里的fileCodeList是包含000000的，以便于CodeUtil产生新的不重复六位数字码
        List<String> fileCodeList = fileInforMapper.getFileCodeList();

        return fileCodeList;
    }
}
